<?php

class Ragtek_Helper_User{

    /**
     * return the neweest users
     * @static
     * @param int $counter how many users should be fetched?
     * @param null $userModel if no model is sent, the method creates a instance
     * @return 
     */
    public static function getNewestUsers($counter = 8, $userModel = NULL){
        if ($userModel == NULL){
            $userModel = XenForo_Model::create('XenForo_Model_User');
        }
        // most recent registrations
		$latestCriteria = array(
            'user_state' => 'valid',
            'is_banned' =>  0

        );

		$latestUsers = $userModel->getLatestUsers($latestCriteria, array('limit' => $counter));
        return $latestUsers;
    }
}